home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / mozilla-firefox / include / content / nsINameSpaceManager.h < prev    next >
C/C++ Source or Header  |  2006-05-08  |  4KB  |  108 lines

  1. /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
  2. /* ***** BEGIN LICENSE BLOCK *****
  3.  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  4.  *
  5.  * The contents of this file are subject to the Mozilla Public License Version
  6.  * 1.1 (the "License"); you may not use this file except in compliance with
  7.  * the License. You may obtain a copy of the License at
  8.  * http://www.mozilla.org/MPL/
  9.  *
  10.  * Software distributed under the License is distributed on an "AS IS" basis,
  11.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  12.  * for the specific language governing rights and limitations under the
  13.  * License.
  14.  *
  15.  * The Original Code is Mozilla Communicator client code.
  16.  *
  17.  * The Initial Developer of the Original Code is
  18.  * Netscape Communications Corporation.
  19.  * Portions created by the Initial Developer are Copyright (C) 1998
  20.  * the Initial Developer. All Rights Reserved.
  21.  *
  22.  * Contributor(s):
  23.  *
  24.  * Alternatively, the contents of this file may be used under the terms of
  25.  * either of the GNU General Public License Version 2 or later (the "GPL"),
  26.  * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
  27.  * in which case the provisions of the GPL or the LGPL are applicable instead
  28.  * of those above. If you wish to allow use of your version of this file only
  29.  * under the terms of either the GPL or the LGPL, and not to allow others to
  30.  * use your version of this file under the terms of the MPL, indicate your
  31.  * decision by deleting the provisions above and replace them with the notice
  32.  * and other provisions required by the GPL or the LGPL. If you do not delete
  33.  * the provisions above, a recipient may use your version of this file under
  34.  * the terms of any one of the MPL, the GPL or the LGPL.
  35.  *
  36.  * ***** END LICENSE BLOCK ***** */
  37.  
  38. #ifndef nsINameSpaceManager_h___
  39. #define nsINameSpaceManager_h___
  40.  
  41. #include "nsISupports.h"
  42. #include "nsAString.h"
  43.  
  44. class nsIAtom;
  45. class nsString;
  46.  
  47. #define kNameSpaceID_Unknown -1
  48. // 0 is special at C++, so use a static const PRInt32 for
  49. // kNameSpaceID_None to keep if from being cast to pointers
  50. static const PRInt32 kNameSpaceID_None = 0;
  51. #define kNameSpaceID_XMLNS    1 // not really a namespace, but it needs to play the game
  52. #define kNameSpaceID_XML      2
  53. #define kNameSpaceID_XHTML    3
  54. #define kNameSpaceID_XLink    4
  55. #define kNameSpaceID_XSLT     5
  56. #define kNameSpaceID_XBL      6
  57. #define kNameSpaceID_MathML   7
  58. #define kNameSpaceID_RDF      8
  59. #define kNameSpaceID_XUL      9
  60. #define kNameSpaceID_SVG      10
  61. #define kNameSpaceID_XMLEvents 11
  62. #define kNameSpaceID_XHTML2_Unofficial    12
  63. #define kNameSpaceID_WAIRoles  13
  64. #define kNameSpaceID_WAIProperties 14
  65. #define kNameSpaceID_LastBuiltin          14 // last 'built-in' namespace
  66.  
  67. #define NS_NAMESPACEMANAGER_CONTRACTID "@mozilla.org/content/namespacemanager;1"
  68.  
  69. #define NS_INAMESPACEMANAGER_IID \
  70.   { 0x30977ca5, 0xc6af, 0x4687, \
  71.     { 0x88, 0x43, 0xa9, 0x7d, 0x0f, 0x95, 0x00, 0x17 } }
  72.  
  73. /**
  74.  * The Name Space Manager tracks the associtation between a NameSpace
  75.  * URI and the PRInt32 runtime id. Mappings between NameSpaces and 
  76.  * NameSpace prefixes are managed by nsINameSpaces.
  77.  *
  78.  * All NameSpace URIs are stored in a global table so that IDs are
  79.  * consistent accross the app. NameSpace IDs are only consistent at runtime
  80.  * ie: they are not guaranteed to be consistent accross app sessions.
  81.  *
  82.  * The nsINameSpaceManager needs to have a live reference for as long as
  83.  * the NameSpace IDs are needed.
  84.  *
  85.  */
  86.  
  87. class nsINameSpaceManager : public nsISupports
  88. {
  89. public:
  90.   NS_DEFINE_STATIC_IID_ACCESSOR(NS_INAMESPACEMANAGER_IID)
  91.  
  92.   NS_IMETHOD RegisterNameSpace(const nsAString& aURI, 
  93.                                PRInt32& aNameSpaceID) = 0;
  94.  
  95.   NS_IMETHOD GetNameSpaceURI(PRInt32 aNameSpaceID,
  96.                              nsAString& aURI) = 0;
  97.   NS_IMETHOD GetNameSpaceID(const nsAString& aURI,
  98.                             PRInt32* aNameSpaceID) = 0;
  99.  
  100.   virtual PRBool HasElementCreator(PRInt32 aNameSpaceID) = 0;
  101. };
  102.  
  103. nsresult NS_GetNameSpaceManager(nsINameSpaceManager** aInstancePtrResult);
  104.  
  105. void NS_NameSpaceManagerShutdown();
  106.  
  107. #endif // nsINameSpaceManager_h___
  108.